<?php $comment = $newComment; ?>
<form id="post-comment" action="<?php echo $siteUrl; ?>/article/<?php echo $article->id; ?>#post-comment" method="post">
  <?php if (isset($previewComment) && $previewComment): ?>
    <fieldset>
      <legend>Comment Preview</legend>
      <?php Pants::partial('includes/comment/'.PANTS_FULL, array('comment' => $comment)); ?>
    </fieldset>
  <?php endif; ?>

  <fieldset>
    <legend>Post a comment</legend>

    <p>
      <label for="author">Name</label>
      <input type="text" name="author" id="author" maxlength="32"
          value="<?php echo htmlentities($comment->author); ?>"
          title="Enter your name." />
    </p>

    <p>
      <label for="email">Email</label>
      <input type="text" name="email" id="email" maxlength="64"
          value="<?php echo htmlentities($comment->email); ?>"
          title="Enter your email address (optional)." />
    </p>

    <p>
      <label for="url">Website</label>
      <input type="text" name="url" id="url" maxlength="128"
          value="<?php echo htmlentities($comment->url); ?>"
          title="Enter the URL of your website (optional)" />
    </p>

    <p>
      <label for="title">Title</label>
      <input type="text" class="long" name="title" id="title" maxlength="255"
          title="Enter a title for this comment."
          value="<?php echo htmlentities($comment->title); ?>" />
    </p>

    <p>
      <textarea name="content" rows="6" cols="60"><?php echo htmlentities($comment->content); ?></textarea>
    </p>

    <p class="tip">
      Basic XHTML (including links) is allowed, just don't try anything
      fishy. Your post will be auto-formatted unless you use your own
      <code>&lt;p&gt;</code> tags for formatting.
    </p>

    <p class="noseeum">
      Please don't type anything here unless you're an evil robot:<br />
      <input type="text" id="captcha" name="captcha" maxlength="50" />
      
      <br /><br />
      And especially don't type anything here:<br />
      <textarea name="comment" rows="6" cols="60"></textarea>
    </p>
    
    <p>
      <input type="hidden" name="article_id" value="<?php echo $article->id; ?>" />
      <input type="submit" name="action" value="Preview Comment" />
      <input type="submit" name="action" value="Post Comment" />
    </p>
  </fieldset>
</form>
